package com.ucode.hrm.typehandler;

import com.ucode.model.hrm.HrmWelfareEvent;
import com.ucode.springboot.starter.mybatis.core.typehandler.AbstractJsonTypeHandler;
import com.ucode.tool.util.JsonUtils;

import java.util.List;

public class HrmWelfareItemListTypeHandler extends AbstractJsonTypeHandler<List<HrmWelfareEvent.WelfareItem>> {

    @Override
    protected List<HrmWelfareEvent.WelfareItem> parse(String json) {
        return JsonUtils.parseArray(json, HrmWelfareEvent.WelfareItem.class);
    }

    @Override
    protected String toJson(List<HrmWelfareEvent.WelfareItem> obj) {
        return JsonUtils.toJsonString(obj);
    }
}

    